<template>
  <div class="statistics-box">
    <div class="statistics-btn" @click="handleClick">
      <i class="icon" :class="isActive ? 'el-icon-download' : 'el-icon-upload2'"></i>
      <span>统计</span>
    </div>
    <div class="statistics-info" :class="isActive ? 'active' : ''">
      <img class="statistics-info-img" :src="require('../assets/images/statistics_info.png')" alt>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Statistics',
  data() {
    return {
      isActive: false
    }
  },
  methods: {
    handleClick() {
      this.isActive = !this.isActive
    }
  }
}
</script>

<style lang="less">
.statistics-box {
  position: absolute;
  left: 20px;
  bottom: 20px;

  .statistics-btn {
    width: 324px;
    height: 40px;
    background-image: url(../assets/images/statistics_btn_bg.png);
    background-size: 100% 100%;
    cursor: pointer;
    color: #ffffff;
    font-size: 16px;

    display: flex;
    justify-content: center;
    align-items: center;

    .icon {
      font-size: 18px;
      margin-right: 4px;
    }
  }

  .statistics-info {
    visibility: hidden;
    position: absolute;
    bottom: 40px;


    &.active {
      visibility: visible;
    }

    .statistics-info-img {
      width: 474px;
    }
  }
}
</style>